﻿using System;
using RootMotion.FinalIK;
using UnityEngine;

namespace RootMotion.Demos
{
	// Token: 0x0200008F RID: 143
	public class BipedIKvsAnimatorIK : MonoBehaviour
	{
		// Token: 0x0600051E RID: 1310 RVA: 0x00032F60 File Offset: 0x00031160
		public void OnAnimatorIK(int layer)
		{
			this.animator.transform.rotation = this.bipedIK.transform.rotation;
			Vector3 b = this.animator.transform.position - this.bipedIK.transform.position;
			this.lookAtTargetAnimator.position = this.lookAtTargetBiped.position + b;
			this.bipedIK.SetLookAtPosition(this.lookAtTargetBiped.position);
			this.bipedIK.SetLookAtWeight(this.lookAtWeight, this.lookAtBodyWeight, this.lookAtHeadWeight, this.lookAtEyesWeight, this.lookAtClampWeight, this.lookAtClampWeightHead, this.lookAtClampWeightEyes);
			this.animator.SetLookAtPosition(this.lookAtTargetAnimator.position);
			this.animator.SetLookAtWeight(this.lookAtWeight, this.lookAtBodyWeight, this.lookAtHeadWeight, this.lookAtEyesWeight, this.lookAtClampWeight);
			this.footTargetAnimator.position = this.footTargetBiped.position + b;
			this.footTargetAnimator.rotation = this.footTargetBiped.rotation;
			this.bipedIK.SetIKPosition(AvatarIKGoal.LeftFoot, this.footTargetBiped.position);
			this.bipedIK.SetIKRotation(AvatarIKGoal.LeftFoot, this.footTargetBiped.rotation);
			this.bipedIK.SetIKPositionWeight(AvatarIKGoal.LeftFoot, this.footPositionWeight);
			this.bipedIK.SetIKRotationWeight(AvatarIKGoal.LeftFoot, this.footRotationWeight);
			this.animator.SetIKPosition(AvatarIKGoal.LeftFoot, this.footTargetAnimator.position);
			this.animator.SetIKRotation(AvatarIKGoal.LeftFoot, this.footTargetAnimator.rotation);
			this.animator.SetIKPositionWeight(AvatarIKGoal.LeftFoot, this.footPositionWeight);
			this.animator.SetIKRotationWeight(AvatarIKGoal.LeftFoot, this.footRotationWeight);
			this.handTargetAnimator.position = this.handTargetBiped.position + b;
			this.handTargetAnimator.rotation = this.handTargetBiped.rotation;
			this.bipedIK.SetIKPosition(AvatarIKGoal.LeftHand, this.handTargetBiped.position);
			this.bipedIK.SetIKRotation(AvatarIKGoal.LeftHand, this.handTargetBiped.rotation);
			this.bipedIK.SetIKPositionWeight(AvatarIKGoal.LeftHand, this.handPositionWeight);
			this.bipedIK.SetIKRotationWeight(AvatarIKGoal.LeftHand, this.handRotationWeight);
			this.animator.SetIKPosition(AvatarIKGoal.LeftHand, this.handTargetAnimator.position);
			this.animator.SetIKRotation(AvatarIKGoal.LeftHand, this.handTargetAnimator.rotation);
			this.animator.SetIKPositionWeight(AvatarIKGoal.LeftHand, this.handPositionWeight);
			this.animator.SetIKRotationWeight(AvatarIKGoal.LeftHand, this.handRotationWeight);
		}

		// Token: 0x040003BC RID: 956
		public Animator animator;

		// Token: 0x040003BD RID: 957
		public BipedIK bipedIK;

		// Token: 0x040003BE RID: 958
		public Transform lookAtTargetBiped;

		// Token: 0x040003BF RID: 959
		public Transform lookAtTargetAnimator;

		// Token: 0x040003C0 RID: 960
		public float lookAtWeight = 1f;

		// Token: 0x040003C1 RID: 961
		public float lookAtBodyWeight = 1f;

		// Token: 0x040003C2 RID: 962
		public float lookAtHeadWeight = 1f;

		// Token: 0x040003C3 RID: 963
		public float lookAtEyesWeight = 1f;

		// Token: 0x040003C4 RID: 964
		public float lookAtClampWeight = 0.5f;

		// Token: 0x040003C5 RID: 965
		public float lookAtClampWeightHead = 0.5f;

		// Token: 0x040003C6 RID: 966
		public float lookAtClampWeightEyes = 0.5f;

		// Token: 0x040003C7 RID: 967
		public Transform footTargetBiped;

		// Token: 0x040003C8 RID: 968
		public Transform footTargetAnimator;

		// Token: 0x040003C9 RID: 969
		public float footPositionWeight;

		// Token: 0x040003CA RID: 970
		public float footRotationWeight;

		// Token: 0x040003CB RID: 971
		public Transform handTargetBiped;

		// Token: 0x040003CC RID: 972
		public Transform handTargetAnimator;

		// Token: 0x040003CD RID: 973
		public float handPositionWeight;

		// Token: 0x040003CE RID: 974
		public float handRotationWeight;
	}
}
